import './style';
import React, { PureComponent } from 'react';
import { GlobalIconStyle } from './static/iconfont/iconfont'
import { GlobalStyle } from './style'
import { Provider } from 'react-redux'
import { BrowserRouter,Route } from 'react-router-dom'
import store from './store'
import Header from './common/header'
import Home from './pages/home'
import Detail from './pages/detail'
import Login from './pages/login'
import Write from './pages/write'

//Provider将store提供给所有的内部组件
class App extends PureComponent {
  render() {
    return (
      <div>
        <GlobalIconStyle/>
        <GlobalStyle/>
        <Provider store={store}>
          <BrowserRouter>
            <div>
              <Header/>
              <Route path='/login' exact component={Login}></Route>
              <Route path='/Write' exact component={Write}></Route>
              <Route path='/' exact component={Home}></Route>
              <Route path='/detail/:id' component={Detail}></Route>
            </div>
          </BrowserRouter>
        </Provider>
      </div>
    );
  }
}

export default App;
